package co.kr.hanbitedu.android.sample;

import android.app.Activity;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.CompoundButton;

public class CheckBoxDemo extends Activity 
	implements CompoundButton.OnCheckedChangeListener {

	/** Called when the activity is first created. */
	CheckBox cb;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        cb = (CheckBox) findViewById(R.id.check);
        cb.setOnCheckedChangeListener(this);
    }
    
    @Override
	public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
		// TODO Auto-generated method stub
    	if (isChecked) {
			cb.setText("This checkbox is: checked");
		} else {
			cb.setText("This checkbox is: unchecked");
		}
	}
}